
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:ace="http://www.icefaces.org/icefaces/components" xmlns:ice="http://www.icesoft.com/icefaces/component" xmlns:icecore="http://www.icefaces.org/icefaces/core" xmlns:ui="http://java.sun.com/jsf/facelets">
    
     
	<ui:composition template="../../WEB-INF/templates/template.xhtml">


		<ui:param name="title" value="Fact Entry System"/>
        	
		<ui:define name="header">
			<ui:include src="../../WEB-INF/templates/header.xhtml"/> 
		</ui:define>
		
		<ui:define name="menu">		
			<ui:include src="../../WEB-INF/templates/menuLeft.xhtml"/>               
		</ui:define>
		
		<ui:define name="content">
			
			<style type="text/css">
			               
			.icePnlGrdFtr {
			    padding-left: 120px;
			    padding-top: 60px;
			}
							
            </style>
<script type="text/javascript">
	function deleteConfirmation(makeId,makeName)
	{
		document.getElementById("deleteMsg").innerHTML="Make Name :"+makeName;
		document.getElementById("form:deleteMakeId").value=makeId;
		confirmation.show();
	}
	function setEditId(makeId) 
	{
	    document.getElementById("form:editMakeId").value=makeId;
	}
</script>	
            
			<h:panelGrid styleClass="managementHeaderTable" width="100%" columns="5" cellspacing="3" cellpadding="3">
            <h:outputText value="Entry Set Management"/>              
            	
            	 <h:outputText value="Month"/>
               
					<ice:selectOneMenu styleClass="monthYearSelectBox" partialSubmit="true" value="#{entrySetBean.month}" valueChangeListener="#{entrySetBean.toggleMonth}" >
					        <f:selectItem itemLabel="Select Month" itemValue="9999" />
	   						<f:selectItems value="#{selectBoxBean.monthList}" />
	 				</ice:selectOneMenu>
	 				
                    <h:outputText value="Year"/>
                    <ice:selectOneMenu styleClass="monthYearSelectBox"  partialSubmit="true" value="#{entrySetBean.year}" valueChangeListener="#{entrySetBean.toggleYear}" >
                            <f:selectItem itemLabel="Select Year" itemValue="9999" />
	   						<f:selectItems value="#{selectBoxBean.yearList}" />
	 				</ice:selectOneMenu>
	 			 
			
            </h:panelGrid> 
            <h:messages globalOnly="true" style="color:green"/>

		  <h:dataTable value="#{entrySetBean.entrySetList}" styleClass="resDataTable" rowClasses="whitebg,graybg" headerClass="resHeader" var="entrySetList"  width="900px" columnClasses="entryMake,entryMarket,entrySegment,entryStatus,entrySelect,entryExecute">
		    <h:column>
		        <f:facet name="header">
		          <div style="float: left;">
				  <h:outputText value="Make"/>
				  </div>
			    </f:facet>
		        <h:outputText  value="#{entrySetList.makeName}" />
		        <h:inputHidden  value="#{entrySetList.makeId}" />
		    </h:column>
			<h:column>
			    <f:facet name="header" >
			    <div style="float: left;">
				  <h:outputText value="Market"/>
				  </div>
			    </f:facet>
		        <h:outputText  value="#{entrySetList.marketName}" />
		        <h:inputHidden  value="#{entrySetList.marketId}" />
		    </h:column>
		    <h:column>
			    <f:facet name="header" >
			    <div style="float: left;">
				  <h:outputText value="Segment"/>
				  </div>
			    </f:facet>
		        <h:outputText  value="#{entrySetList.segmentName}" />
		        <h:inputHidden  value="#{entrySetList.segmentId}" />
		    </h:column>
		    <h:column>
			    <f:facet name="header" >
				  <h:outputText value="Status"/>
			    </f:facet>
		        <h:outputText  value="#{entrySetList.status}" />
		    </h:column>
		    <h:column>
			    <f:facet name="header" >
				  <h:outputText value="Select"/>
			    </f:facet>
			    
			    <c:set var="logRows" value="#{entrySetList.status}" />
			    
			   <h:panelGrid rendered="#{entrySetList.status == null}" styleClass="centerAlign" width="100%" >
			   	<h:selectBooleanCheckbox  type="checkbox" value="#{entrySetList.selected}" />
			   </h:panelGrid>
			    
			    
		        
		    </h:column>
    
    <h:column>
        <f:facet name="header" >
        <h:outputText value="Execute"/>
        </f:facet>
    
				 <h:commandButton value="Execute"  actionListener="#{entrySetBean.createEntrySet}" rendered="#{entrySetList.status == null}">
				     <f:param  name="makeId" value="#{entrySetList.makeId}" />
				     <f:param  name="marketId" value="#{entrySetList.marketId}" />
				     <f:param  name="segmentId" value="#{entrySetList.segmentId}" />
				 </h:commandButton>
	
	</h:column>
	</h:dataTable>
		  
    <h:commandButton value="Execute All"  actionListener="#{entrySetBean.batchEntrySet}">
    </h:commandButton>           
        
        

         </ui:define>
		
		<ui:define name="footer">
	       <ui:include src="../../WEB-INF/templates/footer.xhtml"/> 
		</ui:define>
		
	</ui:composition>

</html>
